package com.sinodoggo.shitcloud.commons;

import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * #Author :Sino
 * #Date   :2022/11/20 7:45
 * #Describe: 统一封装类
 */
@Data
@AllArgsConstructor
public class Result {
    private String code;
    private String message;
    private Object data;

    public static Result success() {
        return new Result(Constants.CODE_200, "请求成功", null);
    }

    public static Result success(Object data) {
        return new Result(Constants.CODE_200, "请求成功", data);
    }

    public static Result fail(String code, String message) {
        return new Result(code, message, null);
    }
}
